/**
 * Created by wangxiaoqiang on 2017/9/15.
 */
let app = new Vue({
    el:"#obj_list",
    data: {
        resources:[]
    },
    mounted:function () {
        this.getCategory()
    },
    methods: {
        getCategory:function () {
            $.get(rootPath+"/category/all",(res)=> {
                if(res.meta.code === 200){
                    this.resources = res.data;
                }
            })
        },
        is_show:function (e) {
            let pid = e.target.dataset.pid;
            let isShow = e.target.dataset.showcode;
            $.get(rootPath+"/category/show",{isShow:isShow,pid:pid},(res)=> {
                if(res.meta.code === 200){
                    this.getCategory()
                }
            })
        },

    }
});
